How does the CPU Calculate 1+1?

Published: 12 January 2022 | Last Updated: 12 January 20223789
The central processing unit (CPU) is an ultra-large-scale integrated circuit. If we want to understand how a computer works, we must first understand how an integrated circuit, which is made up of a huge number of transistors and other electronic components, has computational capacity.To understand the computational capacity of computers, we must first understand how transistors work.
This video will show you how CPU calculate.

How Computers Calculate - the ALU: Crash Course Computer Science #5

Topics covered in this article:
Ⅰ. How transistors represent 0s and 1s
Ⅱ. Gate circuit
Ⅲ. Half and full adders


We all know that looking up tables is at the heart of human processes, and the number of tables we can store is restricted. So, how does a computer accomplish four addition and subtraction operations? Is it a checklist as well? The answer is emphatical no! Let's look at how the CPU  calculates 1+1 today.

Electrical computers are modern computers that rely on circuits and electronic components to function. We all know that the processor (CPU) is at the heart of a computer and is responsible for performing activities. The central processing unit (CPU) is an ultra-large-scale integrated circuit. If we want to understand how a computer works, we must first understand how an integrated circuit, which is made up of a huge number of transistors and other electronic components, has computational capacity.

To understand the computational capacity of computers, we must first understand how transistors work.

 

Ⅰ. How transistors  represent 0s and 1s

From the first computers until the   EDVAC, computers relied on components such as tubes and diodes to perform binary computations using the switching properties of these components. Valve components, on the other hand, have a number of severe drawbacks. For example, excessive heat is produced during operation, as well as poor dependability, sluggish computing speed, high cost, and huge size, all of which impede computer progress. As a result, transistors became commonplace in computer components.

The transistor uses electrical signals to control its own opening and closing, and the switching speed may be extremely high, reaching more than 100 GHz in the laboratory. The construction of electronic circuits has substantially improved since the introduction of transistors, and the second generation of transistor-based electronic computers has entered the era.

The transistor, sometimes known as the triode, was conceived by  Shockley and others at  Bell Labs in 1947. The circuit symbol for a transistor is shown below. It's worth noting that transistors come in a variety of shapes and sizes, with each kind subdivided into N-type and P-type. An N-type transistor is represented by the circuit symbol in the accompanying diagram.

1.jpg

The transistor circuit has two states: on and off, which can be utilized to create a "binary" system. The transistor still has an amplifying state in analog electricity, but in this case, the transistor is utilized in a digital circuit, and it simply has to be used as a switching circuit, that is, it may be turned on and off.

The c and e electrodes in the transistor are turned off when the voltage at b > the voltage at e, as indicated in the diagram above; when the voltage at b the voltage at e, the c and e electrodes in the transistor are switched on. This is merely a simplified version of the situation. In fact, the forward bias and reverse bias of the two PN junctions, as well as the c-pole voltage, are the requirements for turn-on and turn-off in terms of mode electricity. However, because the e-pole and c-pole voltages are normally constant in digital circuits, either provided by the power supply or grounded, we may simply write "the on-off of the transistor circuit is the comparison between the b-pole voltage and the constant e-pole voltage." "I made a high and low decision." In other words, the transistor will be switched on when the b-pole voltage of this transistor is extremely low relative toe, and it will be turned off when it is extremely high relative to e. It can be observed that the transistor's two states of on and off may be described externally by the relative level of the b-pole voltage, demonstrating that the high-level or low-level state can be used to represent binary. That is, the b pole is an input quantity (independent variable) that may be used as a variable to store two values: high or low; the matching output value (dependent variable) represents the circuit's real change: on or off.

The high level is turned off and the low level is turned on in the N-type transistor mentioned above. If we consider the high level to be "1" and the low level to be "0" at this time. The circuit will then be switched off due to the b-pole input 1. If this circuit is used to turn on and off the computer, the computer will be switched off. Machine language works on this basis.

The majority of transistors used in computers and mobile devices are MOS  FETs (metal-oxide-semiconductor field-effect transistors), which are also split into N-type and P-type, with   NMOS   denoting N-type and   PMOS   denoting P-type. The gate in the MOS  can be compared to the b-pole in a transistor, and its voltage controls the on and off states of the entire MOS  tube.

The  NMOS circuit symbol is as follows:

2.jpg

The  PMOS circuit symbol is as follows:

3.jpg

When the gate is high, the  NMOS is switched on, and when the gate is low, it is turned off. As a result, in NMOS, the high level equals "1" and the low level equals "0"; in PMOS, the low level equals "1" and the high level equals "0." By now, you should know that "1" and "0" are simply two electrical signals, precisely two voltage levels that can turn the circuit on and off.

 

Ⅱ. Gate circuit

MOS  has just one gate or input, and the output is only a simple circuit turn-on and turn-off function. It cannot output high or low voltage signals, or represent "1" or "0," and hence cannot complete the computation work. The gate circuit is introduced at this point (hint: voltage, level, and electrical signal are the same thing in this article).

In a digital circuit, the gate circuit is the simplest fundamental logic unit. It is capable of establishing a logical link between the output signal and the input signal. The gate circuit, which is made up of diodes, transistors, and other electrical components, is used to create the unit circuit for basic and complicated logic operations. Only the most fundamental gate circuits are discussed here: AND gate, OR gate, NOT gate, and XOR gate are examples of gates.

1. AND gate

An AND gate circuit indicates that something will happen only if all of the requirements are met.

The circuit diagram below is made up of MOS  tubes. A and B are the inputs, whereas Q is the output.

For example, if A inputs a low level and B produces a high level, Q will output a low level; if A inputs 0 and B outputs 1, Q will output 0, and the corresponding C language operation statement is 0&&1 =0.

4.png

2. OR gate

When one or more conditions are met, something happens in an OR circuit.

The circuit diagram below is made up of MOS  tubes. A and B are the inputs, whereas Q is the output.

If A inputs a low level and B inputs a high level, Q will output a high level; if converted to binary, A inputs 0, B outputs 1, and Q outputs 1, with the matching C language operation equation 0 ||1=1.

5.png

3. NOT gate

The NOT gate circuit is also known as a "no" operation, sometimes known as an "inverse" operation, and is hence referred to as an inverter. Down

The surface is a MOS  tube-based circuit schematic. The NOT gate only has one input, A, and one output, Q.

If A inputs a low level, for example, Q will output a high level; if A inputs 0 in binary, Q will output 1; otherwise, if A inputs 1, Q will get 0, and the analogous C language operation expression is!0=1.

6.png


4. XOR gate

The XOR gate circuit checks whether the two inputs are equal, and the "XOR" indicates that the result is correct. That is, a high level is obtained if the two input levels are different, and a low level is obtained if the two input levels are the same.

The circuit diagram below is made up of MOS  tubes. A and B are the inputs, whereas Q is the output.

For instance, if A inputs a low level and B inputs a high level, and Q outputs a high level, A inputs 0, B outputs 1, and Q outputs 1, and the appropriate C language operation expression is 01 =1.

7.png

We can execute  Boolean operations using these gates.

 

Ⅲ. Half and full adders

We can conduct logical operations using gates, but not yet added. A more complicated circuit device is required to conduct the addition operation: the adder (the adder has a half adder and a full adder). The adder is a complicated circuit made up of many different gate circuits.

Let's say we want to implement the simplest addition operation, which is computing how many times the binary integer 1+1 equals. At this point, we can utilize a half adder. The basic units of the arithmetic operation circuit are the half adder and complete adder. They're a combinational logic circuit that completes 1-bit binary addition; the 1-bit here refers to the 1bit in the popular "1byte=8bit" formula. We'll need eight full adders to accomplish 8-bit binary operations. The half adder's addition does not take into account the carry from the lower level, which is why it's termed half addition.

The figure below is a circuit diagram of a half adder.

8.jpg

An AND gate and an XOR gate circuit make up the half adder. The XOR gate circuit is represented by the box where "=1" is positioned, whereas the AND gate circuit is represented by the box where "&" is located. Because the carry from the low order is not taken into account, the input terminals A and B represent two addends, respectively. S and C0 are the outputs, with S denoting the outcome and C0 denoting the carry.

For example, if A=1, B=0, C0=0, and S=1, then 1+0=1. Carry C0=1, S=0 when A=1, B=1, i.e. 1+1=10. This 10 is binary, and it is denoted by the number 2 in decimal, i.e. 1+1=2. You should now be able to see how the transistor calculates 1+1=2.

Then we put them all together to make a whole adder. The circuit diagram for a full adder is shown below, which only supports 1bit calculations. Ci-1 is the low carry number, Si is the result, and Ci is the high carry number. Ai and Bi are two addends, Ci-1 is the low carry number, Si is the result, and Ci is the high carry number.

9.jpg

If we link four adders together, we may generate a 4-bit binary, such as 2+3, which is 0010+0011, and the value calculated by the adder is shown in the table below. The calculation begins with the low order bits, just like with regular addition. 0010 is represented by addend A, and 0011 is represented by addend B.

10.jpg

The result of Si: 0101 is decimal 5, and the adder implements the decimal operation 2+3=5.

Summary:

We can now imagine that the CPU's operation unit is a gate circuit made up of various basic electronic components like transistors, and that it is made up of multiple-gate circuits to form a circuit capable of performing various complex operations, and that it completes the operation with the help of the control signal from the control circuit. The greater the number of circuit units, the greater the computational capability.


UTMEL

We are the professional distributor of electronic components, providing a large variety of products to save you a lot of time, effort, and cost with our efficient self-customized service. careful order preparation fast delivery service

Frequently Asked Questions

1. How is the CPU speed calculated?

The calculation formula of CPU operation speed: main frequency = FSB * multiplier.

2. How many calculations can a CPU perform per second?

Most current home computers have a CPU speed of about 5 billion calculations per second. Most of the time, the FLOPS value is used to measure the number of CPU operations and calculations per second. Most of today's CPUs have a "floating point unit" (FPU) that is specially used to process floating point operations. Therefore, what FLOPS measures is actually the execution speed of the FPU.

3. How does the CPU do addition, subtraction, multiplication and division?

The CPU performs operations through combinatorial logic operations, which involve the composition of the CPU and the clock signal pulses.
1. Composition of CPU: CPU is a collection of a large number of "gate circuits".
2. Clock signal: The clock signal is a periodic pulse. Each time the CPU receives a cycle of pulses, a large number of gates are driven. And perform some almost the same operations in each cycle, and these operations pass some variables to convert these variables into other variables.
Related Articles

  • Discovering New and Advanced Methodology for Determining the Dynamic Characterization of Wide Bandgap Devices
    Discovering New and Advanced Methodology for Determining the Dynamic Characterization of Wide Bandgap Devices
    Saumitra Jagdale15 March 20242183

    For a long era, silicon has stood out as the primary material for fabricating electronic devices due to its affordability, moderate efficiency, and performance capabilities. Despite its widespread use, silicon faces several limitations that render it unsuitable for applications involving high power and elevated temperatures. As technological advancements continue and the industry demands enhanced efficiency from devices, these limitations become increasingly vivid. In the quest for electronic devices that are more potent, efficient, and compact, wide bandgap materials are emerging as a dominant player. Their superiority over silicon in crucial aspects such as efficiency, higher junction temperatures, power density, thinner drift regions, and faster switching speeds positions them as the preferred materials for the future of power electronics.

    Read More
  • Applications of FPGAs in Artificial Intelligence: A Comprehensive Guide
    Applications of FPGAs in Artificial Intelligence: A Comprehensive Guide
    UTMEL29 August 2025558

    This comprehensive guide explores FPGAs as powerful AI accelerators that offer distinct advantages over traditional GPUs and CPUs. FPGAs provide reconfigurable hardware that can be customized for specific AI workloads, delivering superior energy efficiency, ultra-low latency, and deterministic performance—particularly valuable for edge AI applications. While GPUs excel at parallel processing for training, FPGAs shine in inference tasks through their adaptability and power optimization. The document covers practical implementation challenges, including development complexity and resource constraints, while highlighting solutions like High-Level Synthesis tools and vendor-specific AI development suites from Intel and AMD/Xilinx. Real-world applications span telecommunications, healthcare, autonomous vehicles, and financial services, demonstrating FPGAs' versatility in mission-critical systems requiring real-time processing and minimal power consumption.

    Read More
  • Xilinx FPGAs: From Getting Started to Advanced Application Development
    Xilinx FPGAs: From Getting Started to Advanced Application Development
    UTMEL09 September 202562

    This guide is your comprehensive roadmap to understanding and mastering the world of Xilinx FPGA technology. From selecting your first board to deploying advanced AI applications, we'll cover everything you need to know to unlock the potential of these remarkable devices. The global FPGA market is on a significant growth trajectory, expected to expand from USD 8.37 billion in 2025 to USD 17.53 billion by 2035. This surge is fueled by the relentless demand for high-performance, adaptable computing in everything from 5G networks and data centers to autonomous vehicles and the Internet of Things (IoT). This guide will walk you through the key concepts, tools, and products in the Xilinx ecosystem, ensuring you're well-equipped to be a part of this technological revolution.

    Read More
  • Advanced CMOS Devices with Wide Bandgap and Ultrawide Bandgap Technologies
    Advanced CMOS Devices with Wide Bandgap and Ultrawide Bandgap Technologies
    Saumitra Jagdale15 March 20242887

    Power and radio frequency electronics play an increasingly important role in energy-efficient and collaborative future as there is always a demand for faster, smaller, high-voltage and more conductive transistors. Traditionally, silicon has been the semiconductor of choice due to its extensive research and manufacturing history, and natural abundance. While silicon power devices continue to maximize performance, many applications are now integrating wider-band gap semiconductors. These materials offer a significantly higher voltage-conducting capacity, surpassing silicon's limits in tradeoffs related to ON-resistance, capacitances, and breakdown voltage.

    Read More
  • FPGA in Industry and Communication: Key Players, Technologies, and Future Trends
    FPGA in Industry and Communication: Key Players, Technologies, and Future Trends
    UTMEL07 March 20251055

    FPGAs (Field Programmable Gate Arrays) have become the core hardware in the industrial and communication fields due to their programmability and parallel processing capabilities.

    Read More